package cn.javacart.jopencart.library;

import com.jfinal.kit.StrKit;

/**
 * URL处理
 * @author farmer
 *
 */
public class UrlService {

	private static UrlService urlService = null;
	
	private UrlService(){}
	
	/**
	 * 单例
	 * @return
	 */
	public static synchronized UrlService getInstance() {
		if (urlService == null) {
			urlService = new UrlService();
		}
		return urlService;
	}
	
	/**
	 * 创建链接
	 * @return
	 */
	public String link(String route , String args){
		if(StrKit.notBlank(args)){
			return "/index.php?route="+route+"&"+args;
		}
		return "/index.php?route="+route;
	}
}
